﻿using DevExpress.ExpressApp;
using DevExpress.ExpressApp.SystemModule;

namespace EasyXaf.EntityDesigner.Controllers;

public class DisableFilterViewController : ViewController<ListView>
{
    private FilterController _filterController;

    protected override void OnActivated()
    {
        base.OnActivated();

        _filterController = Frame.GetController<FilterController>();
        if (_filterController != null)
        {
            _filterController.Active[Name] = false;
        }
    }

    protected override void OnDeactivated()
    {
        _filterController?.Active.RemoveItem(Name);

        base.OnDeactivated();
    }
}
